package com.design.pattern.creational.singleton;


import java.util.HashMap;
import java.util.Map;

/**
 * description
 *
 * @author RenQiQiang 2019/02/19 15:08
 */
public class ContainerSingleton {

    private static Map<String, Object> singleMap =  new HashMap<>();

    private ContainerSingleton(){

    }
    public static void putInstance(String key, Object install){
        if(key!=null&&"".equals(key.trim())&&install!=null){
//            singleMap.putIfAbsent(key, install);
        }
    }

    public static Object getInstance(String key){
        return singleMap.get(key);
    }
}
